/*
 * @Author: xiaotiwen
 * @Date: 2020-05-26 17:26:00
 * @LastEditTime: 2020-07-01 16:58:34
 * @LastEditors: xiaotiwen
 * @FilePath: \eduweb\src\api\practiceManagement\fundingManagement.js
 * @Description: 经费管理接口
 */
import fetch from 'common/src/utils/fetch';
import baseUrl from './env';
import UTILS from "common/src/utils/utils";

// 列表
export function getList(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassFundsInfoT/query`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 详情
export function getDetails(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassFundsInfoT/getDetail`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 经费申请-保存
export function fundApplication(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassFundsInfoT/fundApplication`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 经费申请-提交
export function fundSubmit(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassFundsInfoT/fundSubmit`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 经费申请_编辑保存
export function editFundSave(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassFundsInfoT/editFund`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
//导出
export function exportData(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassFundsInfoT/exportTable`,
        method: "post",
        responseType: "blob",
        data
    }).then(res => {
        UTILS.downloadFile(
            res,
            "经费管理列表",
            "application/vnd.ms-excel;charset=utf-8"
        );
    });
}
//导出
export function exportPdf(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassFundsInfoT/exportPdf`,
        method: "post",
        responseType: "blob",
        data
    }).then(res => {
        UTILS.downloadFile(
            res,
            "报销单.pdf",
            "application/vnd.ms-pdf;charset=utf-8"
        );
    });
}
// 审核通过后驳回
export function reApply(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassFundsInfoT/rejectApply?id=`+data,
        method: 'GET'
    });
}